<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <?php include_once 'Application/Views/templates/encabezado.php'; ?>
        <script>
            function registerUser() {
//                if ($('#formSend').valid)
                var url = "<?php echo Class_config::get('urlApp') ?>?controller=Usuario&action=Register";
                var data1 = {user: $('#user').val(),
                    password: $('#password').val(),
                    email: $('#email').val(),
                    dni: $('#documentIden').val(),
                    namePerson: $('#nameP').val(),
                    lastName: $('#Lastname').val(),
                    address: $('#address').val(),
                    phone: $('#phone').val(),
                    movil: $('#celphone').val()
                }

                $.post(url,
                        data1,
                        function(data) {
                            console.log('Se ha guardado con exito');
                        }
                );
                alert('Se ha guardado con exito');
            }
        </script>

    </head>


    <body>

        
        <script>(function(d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id))
                    return;
                js = d.createElement(s);
                js.id = id;
                js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1&appId=APP_ID";
                fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));</script>
        <?php include_once 'Application/Views/templates/body.php'; ?>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span3">
                    <?php include_once 'Application/Views/templates/menu.php'; ?>

                    <div class="span9" style="width: 400px">

                        <form id="formSend" class="form-signin" action="<?php echo Class_config::get('urlApp') ?>?controller=DetallePersona&action=Register">
                            <h2 class="form-signin-heading"><?php echo Class_message::get('ButtonItemRegister') ?></h2>
                            <input type="text" title="<?php echo Class_message::get('TextItemValidateYourUsername') ?>" class="input-block-level" placeholder="<?php echo Class_message::get('TextItemEnterYourUsername') ?>" id="user" required="true">
                            <input type="password" title="<?php echo Class_message::get('TextItemValidateYourPassword') ?>"  class="input-block-level" placeholder="<?php echo Class_message::get('TextItemEnterYourPassword') ?>" id="password" required="true">
                            <input type="email" title="<?php echo Class_message::get('TextItemValidateYourEmail') ?>" class="input-block-level" placeholder="<?php echo Class_message::get('TextItemEnterYourEmail') ?>" id="email" required="true">
                            <input type="text" title="<?php echo Class_message::get('TextItemValidateYourDni') ?>"  id="documentIden" placeholder="<?php echo Class_message::get('TextItemEnterYourDni') ?>" required="true" min="8" maxlength="8"> 
                            <input type="text" id="nameP" placeholder="<?php echo Class_message::get('TextItemEnterYourName') ?>" required="true" maxlength="80">
                            <input type="text" id="Lastname" placeholder="<?php echo Class_message::get('TextItemEnterYourLastName') ?>"   required="true" maxlength="80">
                            <input type="text" id="address" placeholder="<?php echo Class_message::get('TextItemEnterYourAddress') ?>" maxlength="120">
                            <input type="tel"  maxlength="9" id="phone" placeholder="<?php echo Class_message::get('TextItemEnterYourPhone') ?>">
                            <input type="tel"  id="celphone" placeholder="<?php echo Class_message::get('TextItemEnterYourCelphone') ?>">
                            <br>
                            <button  class="btn btn-large btn-primary" ><?php echo Class_message::get('ButtonItemRegister') ?></button>

                        </form>
                        <div class="fb-login-button" data-show-faces="true" data-width="200" data-max-rows="1"></div>

                    </div> <!-- /container -->

                </div>
            </div>
        </div>

    </body>
</html>
<!--onclick="registerUser()"-->